﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnesSystem.Models;
using MongoDB.Bson;
using MongoDB.Driver;
using AnesSystem.Models.Model;

namespace AnesSystem.Services
{
    public class PatientLaborEventService : BaseService<PatientLaborEventService, PatientLaborEventModel>
    {
        public List<PatientLaborEventModel> GetPatientEvents8Time(string pid, DateTime start)
        {
            var filter = Builders<BsonDocument>.Filter;
            var query = Builders<BsonDocument>.Filter.And(filter.Eq("PatientID", pid),
                                                           Builders<BsonDocument>.Filter.Gte("BeginTime", start));
            return FindAll(query).ToList();
        }

        public List<PatientLaborEventModel> GetPatientEvents8Id(string pid)
        {
            var filter = Builders<BsonDocument>.Filter;
            var query = Builders<BsonDocument>.Filter.And(filter.Eq("PatientID", pid));
            return FindAll(query).ToList();
        }
    }
}
